package com.wmg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wmg.entity.User;
import com.wmg.mapper.UserMapper;
import com.wmg.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wmg.utils.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wmg
 * @since 2021-12-22
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User checkUser(String name, String pwd) {
        return userMapper.selectOne(new QueryWrapper<User>().eq("name",name).eq("pwd", MD5Utils.code(pwd)));
    }
 }
